package com.jake.springboot.threadpool.service.impl;

import com.jake.springboot.threadpool.service.EmailService;
import com.jake.springboot.threadpool.util.ThreadUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class EmailServiceImpl implements EmailService {

    @Override
    @Async
    public void sendEmail(String username) {
        log.info("开始向{}@mastermind.com发送邮件", username);
        ThreadUtils.sleep(3000);
        log.info("邮件发送成功！");
    }
}
